package service;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import entity.User;
import dao.UserMapper;
import service.UserService;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Resource
    private UserMapper userMapper;

    @Override
    public int deleteByPrimaryKey(Integer uid) {
        return userMapper.deleteByPrimaryKey(uid);
    }

    @Override
    public int insert(User record) {

        record.setUposts("0");
        record.setUcomments("0");
        record.setUimg("moren.jpg");
        record.setUblog("这个人很懒什么也没留下");

        return userMapper.insert(record);
    }

    @Override
    public int insertSelective(User record) {
        return userMapper.insertSelective(record);
    }

    @Override
    public User selectByPrimaryKey(Integer uid) {
        return userMapper.selectByPrimaryKey(uid);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        return userMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public User userlogin(String uphone) {
        return userMapper.userlogin(uphone);
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return userMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<User> getRight(Integer id) {
        return userMapper.getRight(id);
    }

    @Override
    public List<User> getlike(Integer id) {
        return userMapper.getlike(id);
    }

    @Override
    public List<User> getComment(Integer id) {
        return userMapper.getComment(id);
    }

}
